import {Component} from '@angular/core';
import {NavController, NavParams} from 'ionic-angular';

import {Backend} from '../../providers/backend';
import {ImagePipe} from '../../pipes/pipes';
import {TabArticle} from './tab-previous-article';
import {TabList} from './tab-previous-list';
import {TabVideo} from './tab-previous-video';

@Component({
  templateUrl: 'build/pages/tab-events/tab-previousInfo.html',
  pipes: [ImagePipe],
})
export class TabPreviousInfo {

  static get parameters() {
    return [[NavController], [NavParams], [Backend]];
  }

  constructor(nav, params, backend) {
    this.nav = nav;
    this.params = params;
    this.backend = backend;
    this.result={};
    console.log(params.data.item);

    this.item = params.get('item');
    this.kind = this.item .kind;
    console.log(this.item);
    this.backend.dsFind({
      e: params.data.item.id + '-timelineEvent-edit'
    }).then((result) => {
      console.log(result);
     
      this.result = result;
    });
  }

  overviewSelect(item, title){
    this.nav.push(TabArticle, { item: {item, title: title, id: 1} });
  }
  openingSelect(item, title){
    this.nav.push(TabList, { item: {item, title: title, id: 2} });
  }
  keynoteSelect(item, title){
    this.nav.push(TabList, { item: {item, title: title, id: 3} });
  }
  productSelect(item, title){
    this.nav.push(TabArticle, { item: {item, title: title, id: 4} });
  }
  videoSelect(item, title){
    this.nav.push(TabVideo, { item: {item, title: title, id: 5} });
  }
}